<template>
  <div>
    <van-field label="资源名称" v-model="form.name"></van-field>
    <van-field label="资源url" v-model="form.url"></van-field>
    <van-button style="background-color: aqua" round @click="add">添加</van-button>

  </div>
</template>

<script>
export default {
  name: "add_ziyuan",
  data() {
    return {
      form: {}
    }
  },
  methods: {
    add() {
      this.$axios.post('/admin/resources', this.form).then(res => {
        if (res.data.code == 200) {
          alert('添加成功')
          this.form = {}
        } else {
          alert(res.data.mes)
        }
      })
    }

  }
}
</script>

<style scoped>

</style>
